package com.changdu.seatunnel.admin.service;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.changdu.seatunnel.admin.entity.DataCenter;
import com.changdu.seatunnel.admin.mapper.DataCenterMapper;

@Service
public class DataCenterService extends ServiceImpl<DataCenterMapper, DataCenter> {

	/**
	 * 根据数据中心名称查询数据中心
	 * @param sourceDataCenter
	 * @return
	 */
	public DataCenter getByCode(String sourceDataCenter) {
		LambdaQueryWrapper<DataCenter> wrapper = new LambdaQueryWrapper<DataCenter>().eq(DataCenter::getCode, sourceDataCenter);
		return getOne(wrapper);
	}

}